package interfaces.rechercheiti;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class PanelPrefPayant extends PanelPref {
    protected JLabel labelPayant;
    protected JCheckBox checkPayant;
    
	public PanelPrefPayant (PanelRechercheItineraire _ri) {
		ri = _ri;
        labelPayant = new JLabel();
        checkPayant = new JCheckBox();
        
        setBackground(new Color(255, 255, 102));
        setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        setForeground(new Color(102, 102, 255));

        labelPayant.setForeground(new Color(255, 0, 0));
        labelPayant.setText("Route payante");

        checkPayant.setText("Eviter");
        checkPayant.setOpaque(false);
        checkPayant.addActionListener(new ActionListener() {
        	public void actionPerformed(ActionEvent e) {
    			setIndifferent(!checkPayant.isSelected());
        	}
        });

        javax.swing.GroupLayout panelPayantLayout = new javax.swing.GroupLayout(this);
        setLayout(panelPayantLayout);
        panelPayantLayout.setHorizontalGroup(
            panelPayantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelPayantLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelPayant, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(36, 36, 36)
                .addComponent(checkPayant)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 432, Short.MAX_VALUE)
                .addComponent(labelNumero)
                .addComponent(flecheMonter)
                .addComponent(flecheDescendre)
                .addContainerGap())
        );
        panelPayantLayout.setVerticalGroup(
            panelPayantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelPayantLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelPayantLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(labelPayant, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE)
                    .addComponent(labelNumero)
                    .addComponent(flecheMonter)
                    .addComponent(flecheDescendre)
                    .addComponent(checkPayant, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        panelPayantLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new Component[] {labelNumero, flecheDescendre, flecheMonter});
        panelPayantLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new Component[] {labelNumero, flecheDescendre, flecheMonter});
    }
}
